/*
 * @Author: linZeJian
 * @Date: 2022-01-06 09:27:37
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-01-06 09:40:04
 * @Description: 
 */

'use strict'
const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

const name = process.env.VUE_APP_TITLE || '网页标题' // 网页标题

module.exports = {
	publicPath: process.env.BASE_URL,
	outputDir: 'dist',
	devServer: {
		disableHostCheck: false,
		// proxy: {
		// 	[process.env.VUE_APP_BASE_API]: {
		// 		target: '',
		// 		assetsPublicPath: '/',
		// 		changeOrigin: true, //是否允许跨越
		// 		pathRewrite: {
		// 			['^' + process.env.VUE_APP_BASE_API]: '', //重写,
		// 		},
		// 	}
		// },
		host: '0.0.0.0',
		port: 9081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
		https: false
	},
	productionSourceMap: false, //去掉.map文件，文件体积会小很多
	// configureWebpack: (config) => {
	// 	config.optimization.minimizer[0].options.terserOptions.compress.drop_console = false
	// },
	configureWebpack: {
    name: name,
    resolve: {
      alias: {
        '@': resolve('src')
      }
    }
  }
}